package org.csu.softwaremetrics_demo.util;

/**
 * @Description: 检查对象、字符串和长整型是否为null或空
 * @Author: Jukomu
 * @Package: com.hwadee.teachingprocessmanagementsystem.util
 * @Project: SpringBoot-demo
 * @name: VerifyUtils
 * @Date: 2024/7/4-21:37
 * @Filename: VerifyUtils
 */
public class VerifyUtils {
    /**
     * 检查对象是否为null或者为空字符串
     * @param param
     * @return
     */
    public static boolean isNull(Object param){
        if (param == null || "".equals(param)){
            return true;
        }
        return false;
    }

    /**
     * 检查对象是否不为null且不为空字符串
     * @param param
     * @return
     */
    public static boolean isNotNull(Object param){
        if (param != null && !"".equals(param)){
            return true;
        }
        return false;
    }

    /**
     * 检查字符串是否为null或者为空字符串
     * @param param
     * @return
     */
    public static boolean isNull(String param){
        if (param == null || "".equals(param)){
            return true;
        }
        return false;
    }

    /**
     * 检查字符串是否不为null且不为空
     * @param param
     * @return
     */
    public static boolean isNotNull(String param){
        if (param != null && !"".equals(param)){
            return true;
        }
        return false;
    }

    /**
     * 检查长整型是否为null
     * @param param
     * @return
     */
    public static boolean isNull(Long param){
        if (param == null){
            return true;
        }
        return false;
    }

    /**
     * 检查长整型是否不为null
     * @param param
     * @return
     */
    public static boolean isNotNull(Long param){
        if (param != null){
            return true;
        }
        return false;
    }
}
